Repository navigation
perf(console): an object list and a record page no longer load the Studio designer's string table on first paint - #37589
Merged
Conversation
Contributor
Author
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA 席位核对 — ACCEPT · head 688b77f · card #37444 (slice C) · area s2-ux · 2026-11-26T14:46ZL1 checklist
Tier: S. Landing: ready + auto-merge by this stroke. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Sales · project thread
Part of #37444. This is slice C of that card: route-level JS an object list and a record page load before first paint that they do not need. The card stays open: the production re-measure (card comment 7193730951) shows no single seam brings the three pages under 2.5 s, and the other slices (eager-closure diet, boot waterfall, render CPU) are filed by the seat as their own cards.
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
Two component modules in
@object-ui/app-shellheld small pure helpers next to React components that import the designer'st()(views/metadata-admin/i18n.ts) and, through it, thestudionamespace's English catalogue (@object-ui/i18n/namespaces/studio, its own 69 KB gzipped chunk). The running app's save paths that load with a list or record page import those helpers, so the static import pulled the whole designer table, the Studio header and the Customize controls into both pages' first load.views/studio-design/customizeOverride.ts(new): the Customize door's pure half, moved verbatim out ofStudioCustomizeControls.tsx(STUDIO_CUSTOMIZE_TYPES,isStudioCustomizeType,declaredOverrideOf,overrideDraftBody,customizeDoorWalled,useCustomizeDoorWalled,OBJECT_EXTENSION_TYPE,extensionFieldName,objectExtensionBodyOf,ObjectExtensionBody).views/metadata-admin/draftVersionGuard.ts(new): the draft-version guard's pure half, moved verbatim out ofDraftConflictDialog.tsx(the conflict predicates, the pins,readDraftForSave,DraftVersionGuard,heldDraftVersionOfand their types).useDraftSaveGuardand the dialog, which render and translate, stay where they were.runtime-metadata-persistence.ts,recordTabsConfigSave.ts,objectExtensionArrangementSave.ts,RecordTabsConfig.tsx,ReportView.tsx,DashboardView.tsx,metadata-admin/PageShell.tsx,setup/publicForms.ts,objectViewViewCrud.tsx,metadata-admin/detailSaveAtOnce.ts,layout/designModeMenuSave.ts,layout/designModeHeaderPinsSave.ts. Three tests that mockeduseCustomizeDoorWalledonStudioCustomizeControlsnow mock it oncustomizeOverride, where the hook lives.No behaviour, string, route or saved document changes. Changeset:
patchon@object-ui/app-shell,@object-ui/console,@objectstack/console(the Console dist ships the change).Tests
views/__tests__/firstScreenStudioCatalogue-37444.test.ts: walks each first-screen save path's static relative imports in source (type-only imports andimport()excluded) and asserts none reaches the designer string table; the walk proves it sees the edge by requiringDraftConflictDialog.tsxandStudioCustomizeControls.tsxto reach it, and the two new modules import no component module. Ablation: pointingrecordTabsConfigSave.tsback atDraftConflictDialog.jsredsviews/recordTabsConfigSave.ts reaches no designer string table through static imports(1 failed, 5 passed); restored withgit checkout HEAD --.@object-ui/app-shelltests touching any moved name or edited importer: 85 files, 977 tests passed (pnpm exec vitest run --maxWorkers=2over the 85 files, fromui/); the new file 6/6.tsc --noEmitinui/packages/app-shellexit 0;tsc -p tsconfig.test.jsonexit 0.eslintover the 20 changedui/files: 0 errors (181 warnings, allreact-refresh/only-export-componentsof the kind these files already carried).Acceptance notes
Measured effect (production build, the card's conditions) — tree: this branch (
688b77ffsource; Console rebuilt withpnpm console:build),objectstack startwithNODE_ENV=production, Lighthouse 13.6.0 desktop preset, Chrome for Testing 158 headless, 4-core container, 5 runs per page, every run on the requested page, signed in, cold cache:021524cd)Script bytes before LCP: list 2443 → 2349 KB, record 2340 → 2246 KB, home unchanged (1976 KB). The record page gains 157 ms; the list page's bytes drop by the same 94 KB but its LCP does not move, because its critical path is the serial API chain that the chunk loaded beside; home does not load these chunks. All three pages still miss 2500 ms, as the card's reading predicted for any single slice.
Static route closures read off the built Console (
ObjectView/RecordDetailView, non-eager chunks reachable by static import): 441 → 347 KB and 347 → 254 KB gzipped. The eager closure is unchanged (1,991,173 → 1,991,266 bytes gzipped;check:eager-closurereads it in CI).The record page's other large route chunk,
plugin-grid(192 KB gzipped), was looked at and left: rolldown groupsplugin-detail(the record page's own renderer:DetailView,RelatedList, the activity timeline) into it, so it is the page's own code, not a stray. SplittingImportWizard/ bulk-action code out of it is a possible later cut inside the eager/route diet slices.layout/designModeMenuSave.tsalso now reads the new modules, but still reaches the designer table through the app-nav canvas it imports; it loads with design mode, not with a list or record page, so the pin does not list it.L2 owed (not self-reviewed): a contract-tier read is not needed (no governed path; no spec, no protocol change); the seat's L1 reads the CI check-runs.
Verification
Two-minute check:
cd ui && pnpm exec vitest run packages/app-shell/src/views/__tests__/firstScreenStudioCatalogue-37444.test.ts→ 6 passed. In a built Console, theRecordDetailView-*.jsandObjectView-*.jschunks no longer importi18n-ns-studio-en-*.jsthrough any static chain.Read first:
views/metadata-admin/draftVersionGuard.ts(the guard class moved verbatim; check no symbol was left behind thatuseDraftSaveGuardneeds),views/studio-design/StudioCustomizeControls.tsx(the re-export block and the trimmed imports), the three test mocks retargeted tocustomizeOverride.Local gates (derived by dispatch-gates.mjs --commands at the final head)
Head
688b77ff. 39 derived, 39 run, each exit captured before any pipe;dispatch-gates.mjs --ran: 39 derived, 39 run, 0 NOT-MEASURED, 0 UNRUN (exit 0). Every other family (lint, type-check lanes, Test UI, Build and E2E UI, the eager-closure budget) is CI's; this PR's check-runs are the record.node scripts/check-adr-0087-registration.mjs --base origin/main→ exit 0node scripts/check-adr-0087-registration.mjs --self-test→ exit 0node scripts/check-changeset-no-major.mjs --base origin/main→ exit 0node scripts/check-closing-keyword-parity.mjs→ exit 0node scripts/check-closing-keyword-parity.mjs --self-test→ exit 0node scripts/check-comment-mask-corpus.mjs→ exit 0node scripts/check-empty-changeset.mjs --base origin/main→ exit 0node scripts/check-empty-changeset.mjs --self-test→ exit 0node scripts/check-sdui-manifest.mjs→ exit 0node scripts/check-sdui-manifest.mjs --self-test→ exit 0node scripts/ci/snapshot-next.mjs --self-test→ exit 0node scripts/pm/check-governed-queue-guard.mjs --self-test→ exit 0node scripts/pm/release-rehearsal-clone.mjs --self-test→ exit 0node scripts/release-pending-publish.mjs --self-test→ exit 0pnpm --dir ui exec vitest run scripts/→ exit 0pnpm --filter @objectstack/spec run check:duration-unit-keys→ exit 0pnpm check:adr-anchors→ exit 0pnpm check:adr-symbol-anchors→ exit 0pnpm check:changeset-gate-self-tests→ exit 0pnpm check:closed-ceremony-text→ exit 0pnpm check:cross-package-test-inputs→ exit 0pnpm check:dispatcher-error-vocabulary→ exit 0pnpm check:driver-memory-census→ exit 0pnpm check:engine-double-contract→ exit 0pnpm check:gitlink-declared→ exit 0pnpm check:nul-bytes→ exit 0pnpm check:published-files→ exit 0pnpm check:query-options-erasure→ exit 0pnpm check:refd-timer-probe→ exit 0pnpm check:registry-log-declared→ exit 0pnpm check:rest-log-spy-declared→ exit 0pnpm check:skill-identifier-liveness→ exit 0pnpm check:test-source-alias→ exit 0pnpm check:tier-file-adoption→ exit 0pnpm check:type-check-coverage→ exit 0pnpm check:type-check-debt→ exit 0pnpm check:undeclared-dep-imports→ exit 0pnpm check:watch-hint-literal→ exit 0pnpm check:where-matcher→ exit 0Human Minimum
packages/specholds no runtime logic.pnpm lintpasses.main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed. (not touched)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgU8Bf564ZGXi4MfHWb
Generated by Claude Code